package com.lixiaoyu.controller;

import com.lixiaoyu.entity.ExpressBoxData;
import com.lixiaoyu.entity.ExpressData;
import com.lixiaoyu.service.ExpressService;
import com.lixiaoyu.service.impl.ExpressServiceImpl;

import java.util.List;

/**
 * 快递 控制层
 */
public class ExpressController {

    ExpressService expressService = new ExpressServiceImpl();


    public String insertExpress(ExpressData expressData) {

        String returnExpress = expressService.insertExpress(expressData);
        return returnExpress;
    }

    public List<ExpressBoxData> selectAllExpress() {

        return expressService.selectAllExpress();
    }


    public List<ExpressBoxData> selectGetExpress(int getExpressCode) {

        return expressService.selectGetExpress(getExpressCode);
    }

    /**
     *
     * @param getExpressCode    取件码
     * @return  返回 是否删除了 取件码对应的快递
     * */
    public String deleteExpress(int getExpressCode) {

        return expressService.deleteExpress(getExpressCode);
    }

    /**
     * 查询快递  单个查询
     * @param code  取件码
     * @return  返回 整个快递的信息
     */
    public ExpressBoxData selectExpress(String code) {


        return expressService.selectExpress(code);
    }

    /**
     *
     * @param expressCode  快递单号
     * @param expressRemark 快递备注
     * @param next  快递公司
     * @param getExpressPhone 取件人手机号
     * @param code  取件码
     * @return
     */
    public String yesUpdateExpress(String expressCode, String expressRemark, String next, String getExpressPhone, String code) {
        return expressService.yesUpdateExpress(expressCode,expressRemark,next,getExpressPhone,code);
    }
}
